.class public Lcom/hyphenate/chat/EMCallOptions;
.super Ljava/lang/Object;


# instance fields
.field changeVideoResolutionHeight:I

.field changeVideoResolutionWidth:I

.field emaCallManager:Lcom/hyphenate/chat/adapter/EMACallManager;

.field isChangeVideoResolution:Z

.field isUserSetAutoResizing:Z

.field isUserSetMaxFrameRate:Z

.field userSetAutoResizing:Z

.field userSetMaxFrameRate:I


# direct methods
.method constructor <init>(Lcom/hyphenate/chat/adapter/EMACallManager;)V
    .locals 3

    const/4 v2, -0x1

    const/4 v1, 0x0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/hyphenate/chat/EMCallOptions;->emaCallManager:Lcom/hyphenate/chat/adapter/EMACallManager;

    iput-boolean v1, p0, Lcom/hyphenate/chat/EMCallOptions;->isUserSetAutoResizing:Z

    iput-boolean v1, p0, Lcom/hyphenate/chat/EMCallOptions;->isUserSetMaxFrameRate:Z

    iput-boolean v1, p0, Lcom/hyphenate/chat/EMCallOptions;->userSetAutoResizing:Z

    iput v2, p0, Lcom/hyphenate/chat/EMCallOptions;->userSetMaxFrameRate:I

    iput-boolean v1, p0, Lcom/hyphenate/chat/EMCallOptions;->isChangeVideoResolution:Z

    iput v2, p0, Lcom/hyphenate/chat/EMCallOptions;->changeVideoResolutionWidth:I

    iput v2, p0, Lcom/hyphenate/chat/EMCallOptions;->changeVideoResolutionHeight:I

    iput-object p1, p0, Lcom/hyphenate/chat/EMCallOptions;->emaCallManager:Lcom/hyphenate/chat/adapter/EMACallManager;

    return-void
.end method


# virtual methods
.method public enableFixedVideoResolution(Z)V
    .locals 1

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/hyphenate/chat/EMCallOptions;->isUserSetAutoResizing:Z

    iput-boolean p1, p0, Lcom/hyphenate/chat/EMCallOptions;->userSetAutoResizing:Z

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMClient;->callManager()Lcom/hyphenate/chat/EMCallManager;

    move-result-object v0

    iget-object v0, v0, Lcom/hyphenate/chat/EMCallManager;->mRtcConnection:Lcom/superrtc/sdk/RtcConnection;

    if-eqz v0, :cond_0

    invoke-virtual {v0, p1}, Lcom/superrtc/sdk/RtcConnection;->enableFixedVideoResolution(Z)V

    :cond_0
    return-void
.end method

.method public getIsSendPushIfOffline()Z
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMCallOptions;->emaCallManager:Lcom/hyphenate/chat/adapter/EMACallManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMACallManager;->getIsSendPushIfOffline()Z

    move-result v0

    return v0
.end method

.method public getMaxVideoKbps()J
    .locals 2

    iget-object v0, p0, Lcom/hyphenate/chat/EMCallOptions;->emaCallManager:Lcom/hyphenate/chat/adapter/EMACallManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMACallManager;->getVideoKbps()J

    move-result-wide v0

    return-wide v0
.end method

.method public getVideoResolutionHeight()J
    .locals 2

    iget-object v0, p0, Lcom/hyphenate/chat/EMCallOptions;->emaCallManager:Lcom/hyphenate/chat/adapter/EMACallManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMACallManager;->getVideoResolutionHeight()J

    move-result-wide v0

    return-wide v0
.end method

.method public getVideoResolutionWidth()J
    .locals 2

    iget-object v0, p0, Lcom/hyphenate/chat/EMCallOptions;->emaCallManager:Lcom/hyphenate/chat/adapter/EMACallManager;

    invoke-virtual {v0}, Lcom/hyphenate/chat/adapter/EMACallManager;->getVideoResolutionWidth()J

    move-result-wide v0

    return-wide v0
.end method

.method public setAudioSampleRate(I)V
    .locals 0

    invoke-static {p1}, Lcom/superrtc/sdk/RtcConnection;->setAudioSampleRate(I)V

    return-void
.end method

.method public setIsSendPushIfOffline(Z)V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMCallOptions;->emaCallManager:Lcom/hyphenate/chat/adapter/EMACallManager;

    invoke-virtual {v0, p1}, Lcom/hyphenate/chat/adapter/EMACallManager;->setIsSendPushIfOffline(Z)V

    return-void
.end method

.method public setMaxVideoFrameRate(I)V
    .locals 1

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/hyphenate/chat/EMCallOptions;->isUserSetMaxFrameRate:Z

    iput p1, p0, Lcom/hyphenate/chat/EMCallOptions;->userSetMaxFrameRate:I

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMClient;->callManager()Lcom/hyphenate/chat/EMCallManager;

    move-result-object v0

    iget-object v0, v0, Lcom/hyphenate/chat/EMCallManager;->mRtcConnection:Lcom/superrtc/sdk/RtcConnection;

    if-eqz v0, :cond_0

    invoke-virtual {v0, p1}, Lcom/superrtc/sdk/RtcConnection;->setMaxVideoFrameRate(I)V

    :cond_0
    return-void
.end method

.method public setMaxVideoKbps(J)V
    .locals 3

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMClient;->callManager()Lcom/hyphenate/chat/EMCallManager;

    move-result-object v0

    iget-object v0, v0, Lcom/hyphenate/chat/EMCallManager;->mRtcConnection:Lcom/superrtc/sdk/RtcConnection;

    if-eqz v0, :cond_0

    :try_start_0
    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1}, Lorg/json/JSONObject;-><init>()V

    const-string/jumbo v2, "maxVKbps"

    invoke-virtual {v1, v2, p1, p2}, Lorg/json/JSONObject;->put(Ljava/lang/String;J)Lorg/json/JSONObject;

    invoke-virtual {v1}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/superrtc/sdk/RtcConnection;->setConfigure(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :cond_0
    :goto_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMCallOptions;->emaCallManager:Lcom/hyphenate/chat/adapter/EMACallManager;

    invoke-virtual {v0, p1, p2}, Lcom/hyphenate/chat/adapter/EMACallManager;->setVideoKbps(J)V

    return-void

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0
.end method

.method public setMinVideoKbps(I)V
    .locals 0

    invoke-static {p1}, Lcom/superrtc/sdk/RtcConnection;->setMinVideoKbps(I)V

    return-void
.end method

.method public setVideoResolution(II)V
    .locals 6

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMClient;->callManager()Lcom/hyphenate/chat/EMCallManager;

    move-result-object v0

    iget-object v0, v0, Lcom/hyphenate/chat/EMCallManager;->mRtcConnection:Lcom/superrtc/sdk/RtcConnection;

    if-eqz v0, :cond_0

    :try_start_0
    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1}, Lorg/json/JSONObject;-><init>()V

    const-string/jumbo v2, "width"

    invoke-virtual {v1, v2, p1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    const-string/jumbo v2, "heigth"

    invoke-virtual {v1, v2, p2}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    invoke-virtual {v1}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/superrtc/sdk/RtcConnection;->setConfigure(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :cond_0
    :goto_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMCallOptions;->emaCallManager:Lcom/hyphenate/chat/adapter/EMACallManager;

    int-to-long v2, p1

    int-to-long v4, p2

    invoke-virtual {v0, v2, v3, v4, v5}, Lcom/hyphenate/chat/adapter/EMACallManager;->setVideoResolution(JJ)V

    return-void

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0
.end method
